package com.pn.controller;

import com.pn.entity.Result;
import com.pn.model.BuyList;
import com.pn.service.PurchaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/purchase")
@RestController
public class PurchaseController {

    @Autowired
    private PurchaseService purchaseService;

    /**
     * 添加采购单
     * @param buyList
     * @return
     */
    @RequestMapping("/purchase-add")
    private Result addPurchase(@RequestBody BuyList buyList){
        //执行业务
        Result result = purchaseService.savePurchase(buyList);
        //响应
        return result;
    }
}
